<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>
    <style>
         .grouptd {
             position: relative;
         }

         .group {
             display: inline-block;
             width: 100%;
         }

         .groupselect {
             position: absolute;
             top: 0;
             left: 0;
             width: 100%;
             height: 100%;
             border: 0;
         }
     </style>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
               <!--  教练排班列表页 -->
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                    <div class="row">
                    <span class=" col-sm-1 " style="margin: 0 0 5px 0; padding: 0 2px 0 2px">
						<a class="btn btn-info" href="{:U('add')}" value="">新增</a>
						<a class="btn btn-primary" href="{:U('index')}" value="">全部</a>
					</span>
					<form class="form-inline" action="" method="get">
					<div class="rcol-xs-1 col-sm-0" >
						<label class="inline ">用户搜索</label>
                             <select name="field" class="form-control" id='field' onchange="changediv()">
                             	<option <if condition="I('field') eq phone">selected</if> value="phone">电话</option>
                                 <option <if condition="I('field') eq user">selected</if> value="user">用户名</option>
                             </select>
                         <input type="text" name="keyword"  value="{:I('keyword')}" id='keyword' class="form-control">
                       <!--  <button type="button" onclick='shou1()' class="btn btn-purple btn-sm">
                             <span class="ace-icon fa fa-search icon-on-right bigger-110">
                             	搜索
                          		</span>
                             
                       	</button>-->

                        <button type="button" onclick="sou()" class="btn btn-purple btn-sm">
                            <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                            搜索
                        </button>



                      </div>
                      </form>
                    
                    
						<div class="space-4"></div>
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <!-- <th class="center"><input class="check-all" type="checkbox" value=""></th> -->
                                        <th class="center">序号</th>
                                        <th class="center">教练姓名</th>
                                        <th class="center">教练手机号</th>
                                        <th class="center">使用车辆</th>
                                        <th class="center">车型</th>
                                        <th class="center">使用场地</th>
                                        <th class="center">练习类别</th>
                                        <th class="center">科目</th>
                                        <th class="center">排班日期</th>
                                        <th class="center">发布时间</th>
                                        <th class="center">操作 </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php if(!empty($date)){?>
                                    <volist name="date" id="val" key='key'>
                                        <tr> 
                                        	<td class="center">{$key}</td>
                                            <td class="center">{$val['coach_name']}</td>
                                            <td class="center">{$val['phone']}</td>
                                            <td class="center">{$val['car_num']}</td>
                                            <td class="center">{$val['type']}</td>
                                            <td class="center">{$val['site']}</td>
                                            <td class="center">
                                             	<if condition="$val['category'] eq 1">普通</if>
                                             	<if condition="$val['category'] eq 2">模拟</if>
                                            </td>
                                            <td class="center">
                                             	<if condition="$val['course'] eq 1">科目二</if>
                                             	<if condition="$val['course'] eq 2">科目三</if>
                                            </td>
                                             <td class="center">
                                            <volist name="site" id="v" key='k'>
                                             	<if condition="$val['id'] eq $v['app_co_id']">
													{$v['time']|date='Y-m-d',###}<br/>
                                             	</if>
											</volist>
											 </td>
                                            <td class="center">{$val['add_time']|date='Y-m-d',###}</td>
                                            <td class="center">
											<a href="{:U('Appointment/detail',array('id'=>$val['id']))}" >
	                                        <i class="ace-icon fa fa-pencil bigger-100"></i>排班详情</a>
	                                        <!-- <a href="#">
	                                        <i class="ace-icon fa fa-pencil bigger-100"></i>编辑</a>
	                                        <a href="#" onclick="return confirm('你确定要删除吗？');">
	                                        <i class="ace-icon fa fa-pencil bigger-100"></i>删除 </a> -->
                                            </td>
                                        </tr>
                                    </volist>
                                    <?php }else{?>
                                    		<tr>
                                    			<td colspan=11 class='center' style='color:red;'>暂未发布排班信息</td>
                                    		</tr>
                                    <?php  }?>
                                    </tbody>
                                </table>
                                
                                
                                
                            <!-- <div class="cf">
                                <input id="submit" class="btn btn-info" type="button" value="删除">
                            </div> -->
                            {$page}
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->


<!-- <div class="modal-header">
				   <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
				   <h4 class="modal-title" id="myModalLabel">新增</h4>
			  </div>
			  <div class="modal-body">
			
				   <div class="form-group">
					   <label for="txt_departmentname">部门名称</label>
					   <input type="text" name="txt_departmentname" class="form-control" id="txt_departmentname" placeholder="部门名称">
				   </div>
				   <div class="form-group">
					   <label for="txt_parentdepartment">上级部门</label>
					   <input type="text" name="txt_parentdepartment" class="form-control" id="txt_parentdepartment" placeholder="上级部门">
				   </div>
				   <div class="form-group">
					   <label for="txt_departmentlevel">部门级别</label>
					   <input type="text" name="txt_departmentlevel" class="form-control" id="txt_departmentlevel" placeholder="部门级别">
				   </div>
				   <div class="form-group">
					   <label for="txt_statu">描述</label>
					   <input type="text" name="txt_statu" class="form-control" id="txt_statu" placeholder="状态">
				   </div>
			  </div>
			  <div class="modal-footer">
				   <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			  </div> -->

<include file="Public/footerjs"/>

<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(".submit").click(function () {
        $("#form").submit();
    })
    
    function Modal(val,_this){
    	 $("#myModalLabel").text("详情");
    	  $('#myModal').modal();
    }

    function sou(){
        var keyword = $('#keyword').val();
        var field = $('#field').val();
        var param = '';

        if(keyword  && field){
            param += '/field/'+field;
            param += '/keyword/'+keyword;
        }

        location.href="__APP__/Admin/Appointment/index"+param+".html";
    }

</script>
</body>
</html>
